package cn.com.dingtek.genius.manager.server.repository.db.manager;

import cn.com.dingtek.genius.manager.server.repository.db.entity.CompanyDeviceWeb;
import cn.com.dingtek.genius.manager.server.repository.db.mapper.CompanyDeviceWebMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class CompanyDeviceWebManager extends ServiceImpl<CompanyDeviceWebMapper, CompanyDeviceWeb> {


    public void remove(Long companyId, Long deviceId) {
        remove(Wrappers.<CompanyDeviceWeb>query().eq("company_base_id", companyId).eq("device_base_id", deviceId));
    }

    public CompanyDeviceWeb getCompanyDeviceWeb(Long companyId, Long deviceId) {
        return getOne(Wrappers.<CompanyDeviceWeb>query().eq("company_base_id", companyId).eq("device_base_id", deviceId));
    }
}
